package com.nstar.base.effects
{
	import mx.effects.Sequence;
	
	/**
	 * 将表格某行背景色高亮的特效
	 * 
	 * 要使用此特效，必须结合RCDataGrid
	 * 
	 * @author 李嘉陵
	 * @since 2007-05-28
	 */
	public class HighLightColumnSequence extends Sequence
	{
		private var _baseColor:uint = 0xffffff;
		private var _highColor:uint = 0xfff7a0;
		private var _duration:Number = 5000;
		
		
		var beginEffect:HighLightColumn;
		var endEffect:HighLightColumn;
		
		public var _index:int;
		
		/**
		 * 设置第几行高亮
		 */
		public function set index ( value:* ) : void 
		{
			_index = int(value);
			beginEffect.index = _index;
			endEffect.index = _index;
		}
	
		public var targetObj:* = null ;
		
		public function set baseColor(value:uint):void {
			beginEffect.beginColor = value;
			endEffect.endColor = value;
		}
		
		public function set highColor(value:uint):void {
			beginEffect.endColor = value;
			endEffect.beginColor = value;
		}
		
		override public function set duration(value:Number):void {
			//super.duration(value);
			
			beginEffect.duration = value;
			endEffect.duration = value;
		}
		
		public function HighLightColumnSequence(targetObj:* = null) {
			super(targetObj);
			beginEffect = new HighLightColumn(targetObj);
			endEffect = new HighLightColumn(targetObj);
			
			beginEffect.beginColor = _baseColor;
			beginEffect.endColor = _highColor;
			beginEffect.duration = _duration;
			beginEffect.type = HighLightColumn.BEGIN;
			
			endEffect.beginColor = _highColor;
			endEffect.endColor = _baseColor;
			endEffect.duration = _duration;
			endEffect.type = HighLightColumn.END;

			this.children.push(beginEffect);
			this.children.push(endEffect);
		}
	}
}